var mongoose = require("mongoose");

var Schema = mongoose.Schema;
var ObjectId = Schema.ObjectId;

var Message = new Schema({
	content: String,
	creator: {
		_id: ObjectId,
		name: String,
		headUrl: String
	},
	_roomId: ObjectId,
	createAt: {
		type: Date,
		default: Date.now
	}
}, {
	collection: "messages"
})

module.exports = Message;